package org.hpin.asset.dao;

import java.util.List;

import org.hpin.asset.entity.Suppliers;
import org.hpin.base.dict.dao.ID2NameDAO;
import org.hpin.base.dict.exceptions.DictDAOException;
import org.hpin.common.core.orm.BaseDao;
import org.springframework.stereotype.Repository;

@Repository(value="org.hpin.asset.dao.SuppliersDao")
public class SuppliersDao extends BaseDao implements ID2NameDAO{

	@Override
	public String id2Name(String id) throws DictDAOException {
		//System.out.println("获取供应商名称...");
		String queryString = " from Suppliers suppliers where suppliers.id=?";
		List<Suppliers> list = this.getHibernateTemplate().find(queryString,id);
		String name = "";
		if( list != null && list.size() >0){
			Suppliers suppliers = list.get(0);
			name = suppliers.getName();
		}
		//System.out.println("name:"+name);
		return name;
	}

	@Override
	public String id2Field(String id, String beanId, String field)
			throws DictDAOException {
		// TODO Auto-generated method stub
		return null;
	}

}
